﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoMapper;

namespace Data.Mappers
{
    public class RoleMapper : IMapper<Entity.Roles.Role, ModelDatabase.Role>
    {
        public Entity.Roles.Role WrapperData(ModelDatabase.Role obj)
        {
            Mapper.CreateMap<ModelDatabase.Role, Entity.Roles.Role>();
            Mapper.CreateMap<ModelDatabase.User, Entity.Users.User>();

            return Mapper.Map<ModelDatabase.Role, Entity.Roles.Role>(obj);
        }

        public List<Entity.Roles.Role> WrapperData(List<ModelDatabase.Role> obj)
        {
            Mapper.CreateMap<ModelDatabase.Role, Entity.Roles.Role>();
            Mapper.CreateMap<ModelDatabase.User, Entity.Users.User>();

            return Mapper.Map<List<ModelDatabase.Role>, List<Entity.Roles.Role>>(obj);
        }

        public ModelDatabase.Role WrapperEntity(Entity.Roles.Role obj)
        {
            Mapper.CreateMap<Entity.Roles.Role, ModelDatabase.Role>();
            Mapper.CreateMap<Entity.Users.User, ModelDatabase.User>();

            return Mapper.Map<Entity.Roles.Role, ModelDatabase.Role>(obj);
        }

        public List<ModelDatabase.Role> WrapperEntity(List<Entity.Roles.Role> obj)
        {
            Mapper.CreateMap<Entity.Roles.Role, ModelDatabase.Role>();
            Mapper.CreateMap<Entity.Users.User, ModelDatabase.User>();

            return Mapper.Map<List<Entity.Roles.Role>, List<ModelDatabase.Role>>(obj);
        }
    }
}
